package com.gdziarmaga.webshop.web.datatable;

import java.io.Serializable;
import java.util.Set;

import org.ajax4jsf.model.ExtendedDataModel;

/**
 * Interface for table data model. It is necessary to use table model as a
 * spring bean.
 * 
 * @author Wojciech Kochman
 * @version 1.0
 * @param <T> the type of object
 */
public interface BaseTableModel<T> extends Serializable {
    /**
     * Returns the table model.<br />
     * When using implementation of this interface by this method we <b>have
     * to</b> get model. <br />
     * When the implementation is used <b>directly</b> on the page <b>error
     * occurs</b>, because the implementation is type of proxy.
     * 
     * @return the model
     */

    ExtendedDataModel getModel();

    /**
     * Refreshes the data on the list.
     */
    void refresh();
    void clearCache();

    Set<BaseTableRow<T>> getSelectedRows();

    Set<T> getSelectedRowsData();
}
